/*
 Navicat Premium Data Transfer

 Source Server         : 监所
 Source Server Type    : PostgreSQL
 Source Server Version : 90204 (90204)
 Source Host           : 47.108.95.57:15432
 Source Catalog        : sjyy
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 90204 (90204)
 File Encoding         : 65001

 Date: 22/10/2025 16:18:02
*/


-- ----------------------------
-- Table structure for case_person_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."case_person_info";
CREATE TABLE "public"."case_person_info" (
  "id" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "case_id" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "person_name" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "id_number" varchar(18) COLLATE "pg_catalog"."default",
  "gender" int2,
  "age" int4,
  "is_minor" int4 DEFAULT 1,
  "is_student" int4 DEFAULT 1,
  "disposal_type" varchar(20) COLLATE "pg_catalog"."default",
  "create_by" varchar(50) COLLATE "pg_catalog"."default",
  "verify_by" varchar(50) COLLATE "pg_catalog"."default",
  "police_station" varchar(50) COLLATE "pg_catalog"."default",
  "create_time" timestamp(6) NOT NULL DEFAULT pg_systimestamp(),
  "update_by" varchar(32) COLLATE "pg_catalog"."default",
  "update_time" timestamp(6),
  "del_flag" int4 DEFAULT 0,
  "incident_reason" text COLLATE "pg_catalog"."default",
  "police_bureau" varchar(50) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."case_person_info" OWNER TO "guass";
COMMENT ON COLUMN "public"."case_person_info"."id" IS '主键ID';
COMMENT ON COLUMN "public"."case_person_info"."case_id" IS '警情ID';
COMMENT ON COLUMN "public"."case_person_info"."person_name" IS '人员姓名';
COMMENT ON COLUMN "public"."case_person_info"."id_number" IS '身份证号';
COMMENT ON COLUMN "public"."case_person_info"."gender" IS '性别(0未知1男2女)';
COMMENT ON COLUMN "public"."case_person_info"."age" IS '案件发生时年龄';
COMMENT ON COLUMN "public"."case_person_info"."is_minor" IS '案件发生时是否未成年,1 表示未成年人，0表示成年人';
COMMENT ON COLUMN "public"."case_person_info"."is_student" IS '案件发生时是否学生,1 是学生，0 不是学生';
COMMENT ON COLUMN "public"."case_person_info"."disposal_type" IS '处置类型';
COMMENT ON COLUMN "public"."case_person_info"."create_by" IS '录入人';
COMMENT ON COLUMN "public"."case_person_info"."verify_by" IS '核查人';
COMMENT ON COLUMN "public"."case_person_info"."police_station" IS '所属派出所';
COMMENT ON COLUMN "public"."case_person_info"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."case_person_info"."update_by" IS '更新人';
COMMENT ON COLUMN "public"."case_person_info"."update_time" IS '更新时间';
COMMENT ON COLUMN "public"."case_person_info"."del_flag" IS '状态(0:存在 1:删除)';
COMMENT ON COLUMN "public"."case_person_info"."incident_reason" IS '涉事原因';
COMMENT ON COLUMN "public"."case_person_info"."police_bureau" IS '所属分局,用于权限控制';

-- ----------------------------
-- Indexes structure for table case_person_info
-- ----------------------------
CREATE INDEX "case_person_info_case_id_idx_1" ON "public"."case_person_info" USING btree (
  "case_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_case_person_info_case_id_1" ON "public"."case_person_info" USING btree (
  "case_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_case_person_info_del_flag_1" ON "public"."case_person_info" USING btree (
  "del_flag" "pg_catalog"."int4_ops" ASC NULLS LAST
);
CREATE INDEX "idx_case_person_info_disposal_type_1" ON "public"."case_person_info" USING btree (
  "disposal_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_case_person_info_id_1" ON "public"."case_person_info" USING btree (
  "id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_case_person_info_is_minor_1" ON "public"."case_person_info" USING btree (
  "is_minor" "pg_catalog"."int4_ops" ASC NULLS LAST
);
CREATE INDEX "idx_case_person_info_is_student_1" ON "public"."case_person_info" USING btree (
  "is_student" "pg_catalog"."int4_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table case_person_info
-- ----------------------------
ALTER TABLE "public"."case_person_info" ADD CONSTRAINT "case_person_info_pkey_1" PRIMARY KEY ("id");
